package com.lancer.cloud.user.controller;

import com.baomidou.mybatisplus.extension.api.R;
import com.lancer.cloud.common.base.controller.BaseController;
import com.lancer.cloud.user.entity.SysDict;
import com.lancer.cloud.user.service.SysDictService;
import io.swagger.annotations.Api;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 系统字典控制类
 *
 * @author caijinbang
 * @date 2019-01-23 10:58
 */
@RestController
@RequestMapping("/dict")
@Api(value = "字典controller", tags = {"系统字典操作接口"})
public class SysDictController extends BaseController{


    @Autowired
    private SysDictService sysDictService;

    @GetMapping("/top/name")
    public R<List<SysDict>> getTopDictList(@RequestParam String name) {
        return R.ok(sysDictService.getTopDictListByDesc(name));
    }

}
